package Euler36;

import java.util.*;
import ReusableCode.*;

public class BasePalindromes {
	public static void main(String[] args) {
		List<Long> palindromes = MathFunctions.getPalindromes(999);
		int count = 0;
		int sum = 0;
		
		while (count < palindromes.size() && palindromes.get(count) < 1000000)
		{
			long num = palindromes.get(count);
			
			if(MathFunctions.isPalindrome(num, 10) && MathFunctions.isPalindrome(num, 2))
			{
				System.out.println(num);
				sum += num;
			}
			
			count++;
		}
		
		System.out.println("Sum is: " + sum);
	}
}